package net.csdn.business.common.domain.request;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author wanghang
 * @date 2022/6/15 11:37
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class UserSearchDto implements Serializable {

    private String key;

    /**
     * 用户分类
     * Register-注册用户 Suspended-已禁用 Activated-活跃  External-第三方登录 Admin-管理员 Operator-运营 Auditor-审核员
     */
    private String type;

    /**
     * 排序
     * CREATEDAT_DESC、CREATEDAT_ASC、UPDATEDAT_DESC、UPDATEDAT_ASC;
     */
    private String orderBy = "CREATEDAT_DESC";

    @NotNull(message = "页码不能为空")
    @Min(value = 1)
    private Integer page;

    @NotNull(message = "单页条数不能为空")
    @Min(value = 1)
    @Max(value = 100)
    private Integer pageSize;

    @Data
    @AllArgsConstructor
    public static class AdvancedFilter {
        private String field;
        // IN、EQUAL
        private String operator;
        private Object value;
    }

    @Data
    @AllArgsConstructor
    public static class Sort {
        // createdAt、updatedAt
        private String field;
        // asc、desc
        private String order;
    }

    @Data
    @AllArgsConstructor
    public static class ExtIdpId{
        private String extIdpId;
    }


}
